package com.yunhe.javabean;

public class PageControl {
    private int totals;//新闻总条数
    private int pagetotals;// 生成的页面数
    static int pagenum=3;//每个页的存储
    private int currentpage;//当前页面，从前端点击获取
    private int startIndex;//开始的索引
	public int getTotals() {
		return totals;
	}
	
	@Override
	public String toString() {
		return "PageControl [totals=" + totals + ", pagetotals=" + pagetotals
				+ ", currentpage=" + currentpage + ", startIndex=" + startIndex
				+ "pagenum="+pagenum+"]";
	}

	public static int getPagenum() {
		return pagenum;
	}

	public static void setPagenum(int pagenum) {
		PageControl.pagenum = pagenum;
	}

	public void setTotals(int totals) {
		if(totals%pagenum==0){
			this.pagetotals=totals/pagenum;
		}else{
			this.pagetotals=totals/pagenum+1;
		}
		this.totals = totals;
	}
	public int getCurrentpage() {
		return currentpage;
	}
	public void setCurrentpage(int currentpage) {
		this.startIndex=(currentpage-1)*pagenum;
		this.currentpage = currentpage;
	}
    public int getStartIndex() {
		return startIndex;
	}
    public int getPagetotals() {
		return pagetotals;
	}
}
